package com.tbm.console.proj.repository;

import com.tbm.console.base.repository.CommonRepository;
import com.tbm.console.proj.entity.SystemUser;
import com.tbm.console.proj.view.SystemUserLocalUserInfoView;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import java.util.List;

public interface SystemUserRepository extends CommonRepository<SystemUser> {


    @Query(value="SELECT new com.tbm.console.proj.view.SystemUserLocalUserInfoView(u,l)  FROM  SystemUser u, com.tbm.console.proj.entity.LocalUserInfoEntity l WHERE u.id = l.userId ")
    List<SystemUserLocalUserInfoView> findSystemUserLocalUserInfoView(Pageable pageable);

}
